home *** CD-ROM | disk | FTP | other *** search
/ AppleScript - The Beta Release / AppleScript - The Beta Release.iso / Example Scripts / Example Scripts (as text) / Quill Scripts / Transpose Words < prev   
Encoding:
Text File  |  1992-12-02  |  528 b   |  18 lines  |  [TEXT/ToyS]

  1. tell window 1 of application "Quill"
  2.     copy (word after selection) as styled text to x
  3.     if true then
  4.         if word before selection exists then
  5.             copy " " & x to after word before selection
  6.         else
  7.             -- here we are transposing the first word.
  8.             copy x & " " to beginning
  9.         end if
  10.         -- should be "from (end of word of the selection) 
  11.         --                 to (end of the word after the selection)"
  12.         delete text from ¬
  13.             (end of word before word after selection) to ¬
  14.             (end of word after selection)
  15.     end if
  16.     on error
  17.     end error
  18. end tell